package com.apotik.legenda.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;


@Entity
@Table(name="apt_purchases_detail")
public class PurchasesDetail implements Serializable {
private static final long serialVersionUID = 3448025803207298346L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "purchases_detail_id")
	private Long purchasesDetailId;

	@ManyToOne
	@JoinColumn(name="purchases_id", referencedColumnName = "purchases_id", nullable = false)
	private Purchases purchasesId;

	@ManyToOne
	@JoinColumn(name="product_id", referencedColumnName = "product_id", nullable = false)
	private Product productId;
	
	@Column(name="price", nullable = false)
	private BigDecimal price = BigDecimal.ZERO;
	
	@Column(name="ppn_price", nullable = false)
	private BigDecimal ppnPrice = BigDecimal.ZERO;
	
	@Column(name="discount", nullable = false)
	private BigDecimal discount = BigDecimal.ZERO;
	
	@Column(name="count", nullable = false)
	private Integer count = 0;
	
	@Column(name="unit", nullable = false)
	private Integer unit = 0;
	
	@Column(name="notes")
	@Type(type="text")
	private String notes;
	
	@Column(name="status", nullable = false)
	private boolean status;

	public Purchases getPurchasesId() {
		return purchasesId;
	}

	public void setPurchasesId(Purchases purchasesId) {
		this.purchasesId = purchasesId;
	}

	public Product getProductId() {
		return productId;
	}

	public void setProductId(Product productId) {
		this.productId = productId;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public BigDecimal getPpnPrice() {
		return ppnPrice;
	}

	public void setPpnPrice(BigDecimal ppnPrice) {
		this.ppnPrice = ppnPrice;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Integer getUnit() {
		return unit;
	}

	public void setUnit(Integer unit) {
		this.unit = unit;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

}
